﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/BackSite.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    修改我的密码 
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="TablePlaceHolder" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    <div id="title" style="background-image: url('../../Content/images/toolbar_bg.gif'); background-repeat: repeat-x">
        <span class="font16 fLeft" style="font-size: 26px"><strong>修改我的密码</strong></span><span class="fRight mR10 mT08"></span>
    </div>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <style type="text/css">
        .error {
            color: red;
        }

        #Select1 {
            width: 48px;
        }

        #Select2 {
            width: 48px;
        }

        .auto-style1 {
            width: 100%;
        }

        .auto-style2 {
            text-align: right;
        }

        .auto-style3 {
            width: 114px;
        }
    </style>

    <script type="text/javascript">
        $(document).ready(function () {
            $.formValidator.initConfig({ onError: function (msg) { alert(msg) } });
            $("#txtOldPwd").formValidator({ onshow: "请输入旧密码", onfocus: "不能为空", oncorrect: "输入合法" }).InputValidator({ min: 1, onerror: "旧密码不能为空,请确认" });
            $("#txtNewPwd").formValidator({ onshow: "请输入新密码", onfocus: "密码不能为空", oncorrect: "密码合法" }).InputValidator({ min: 1, onerror: "新密码不能为空,请确认" });
            $("#txtConfirmPwd").formValidator({ onshow: "请输入重复密码", onfocus: "两次密码必须一致哦", oncorrect: "密码一致" }).InputValidator({ min: 1, onerror: "确认密码不能为空,请确认" }).CompareValidator({ desID: "txtNewPwd", operateor: "=", onerror: "2次密码不一致,请确认" });
        });

        $(document).ready(function () {
            var ma = $('#form1').validate();

            jQuery.extend(jQuery.validator.messages, {
                required: "必填项",
                remote: "Please fix this field.",
                email: "邮箱格式不正确,请确认",
                url: "URL地址格式错误，请确认",
                date: "日期格式错误，请确认",
                dateISO: "日期格式(ISO)错误，请确认.",
                number: "请输入数字",
                digits: "请输入整数",
                creditcard: "信用卡号码格式错误",
                equalTo: "两次输入不一致",
                accept: "后缀名错误",
                mobile: "手机号码格式错误",
                tel: "电话号码格式错误",
                mobileOrTel: "手机或电话号码格式错误",
                qq: "QQ号码格式错误",
                chinese: "请输入中文",
                idcard: "身份证号码格式错误",
                letter: "请输入字母",
                ip: "IP地址格式错误",
                zipcode: "邮政编码格式错误",
                maxlength: $.validator.format("最多输入 {0} 个字符"),
                minlength: $.validator.format("最少输入 {0} 个字符"),
                rangelength: $.validator.format("字符长度介于 {0} 到 {1} 之间"),
                range: $.validator.format("值大小介于 {0} 到 {1}之间"),
                max: $.validator.format("最大值不超过 {0}"),
                min: $.validator.format("最小值不小于 {0}")
            });
            $("#btnSub").click(function () {
                var txtOldPwd = $("#txtOldPwd").val();
                var txtNewPwd = $("#txtNewPwd").val();
                var txtConfirmPwd = $("#txtConfirmPwd").val();
                $.ajax({
                    type: "POST",
                    url: "updatePwd",
                    data: "txtOldPwd=" + txtOldPwd + "&&txtNewPwd=" + txtNewPwd + "&&txtConfirmPwd=" + txtConfirmPwd,
                    success: function (sesponseTest) {
                        alert(sesponseTest);
                    }
                });
            });
        });
    </script>

    &nbsp;<table class="auto-style1">
        <tr>
            <td class="auto-style2">旧密码：</td>
            <td class="auto-style3">
                <input id="txtOldPwd" type="password" name="action0" />
            </td>
            <td>
                <div id="txtOldPwdTip" style="width: 250px"></div>
            </td>

        </tr>
        <tr>
            <td class="auto-style2">新密码：</td>
            <td class="auto-style3">
                <input id="txtNewPwd" type="password" name="action1" /></td>
            <td>
                <div id="txtNewPwdTip" style="width: 250px"></div>
            </td>
        </tr>
        <tr>
            <td class="auto-style2">确认密码：</td>
            <td class="auto-style3">
                <input id="txtConfirmPwd" type="password" name="action"/></td>
            <td>
                <div id="txtConfirmPwdTip" style="width: 250px"></div>
            </td>
        </tr>
        <tr>
            <td class="auto-style2">
                <input type="submit" id="btnSub" value="提交" /></td>
            <td class="auto-style3">
                <input id="BtnCancel" type="button" value="取消" onclick="document.getElementById('txtOldPwd').value = document.getElementById('txtNewPwd').value = document.getElementById('txtConfirmPwd').value = ''" /></td>
        </tr>
    </table>
    <p>
        &nbsp;&nbsp;
    </p>
    <p>
        &nbsp;&nbsp;
    </p>
    <p>
        &nbsp;&nbsp;&nbsp;
    </p>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="TableHeadPlaceHolder" runat="server">
</asp:Content>
